<!--// 个人信息页面-->
<template>
  <div class="all">
    <el-card>
      <el-descriptions title="个人信息" direction="vertical" :column="4" border>

        <el-descriptions-item label="学号">{{this.userInfo.Name}}</el-descriptions-item>
        <el-descriptions-item label="姓名">{{this.userInfo.realname  }}</el-descriptions-item>
        <el-descriptions-item label="性别">{{this.userInfo.Gender  }}</el-descriptions-item>
        <el-descriptions-item  label="学历">{{Education}}</el-descriptions-item>
        <el-descriptions-item  label="专业">{{Major}}</el-descriptions-item>
        <el-descriptions-item label="手机号">{{this.userInfo.ContactInfo  }}</el-descriptions-item>
        <el-descriptions-item  label="邮箱">{{this.userInfo.email  }}</el-descriptions-item>

      </el-descriptions>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userInfo:{},
      major:"",
      education:""
    };
  },
  created() {
    this.getUserInfo()
  },
  methods:{
    getUserInfo(){
      this.$axios({
        url:'/api/user/userInfo',
        method:'get',
        headers:{
          'Authorization':this.$cookies.get('token')
        }
      }).then(res =>{
        this.userInfo = res.data.data
        console.log(this.userInfo)
      })
    },
    transform(){


    }
  },
  computed:{
    Major(){
      switch (this.userInfo.MajorID){
        case 1:this.major = "计算机科学与技术";break
        case 2:this.major = "电子信息";break
        case 3:this.major = "大数据";break
        case 4:this.major = "物联网";break
        case 5:this.major = "数字媒体";break
      }
      return this.major
    },
    Education(){
      switch (this.userInfo.EducationID){
        case 1:this.education = "本科";break
        case 2:this.education = "硕士";break
      }
      return this.education
    }
  }

};
</script>
<style lang="less" scoped>
.all {
  padding: 0px 40px;
  .page {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edit {
    margin-left: 20px;
  }
  .el-table tr {
    background-color: #dd5862 !important;
  }
}
.el-table .warning-row {
  background: #000 !important;
}

.el-table .success-row {
  background: #dd5862;
}
</style>
